<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link rel="stylesheet" type="text/css" href="view/default.css"/>
	<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
	<title>myScheduleChange</title>
</head>
<body>
	<div class="header">
		<jsp:include page="head.html"/>
	</div>
	<div class="sidebar">
		<jsp:include page="navigation.jsp"/>
	</div>
	<div class="page">
		<h1>
		<c:out value="${title}"/>
		</h1>
		<p>
		<c:out value="${message}"/>
		</p>
		<!-- Form um Dropdown Menüs miteinander zu verknüpfen -->
		<form method="post" action="AllKurse.s" name="kursauswahl">
		
		
						<!-- Dynamisches Dropdown Menü zur Auswahl des Semesters -->
						<select name="semester" onchange="document.kursauswahl.submit()">
						<option value="0">W&auml;hle das Semester</option>
							<% for(int i=1; i<=7; i++) {%>
							<c:set var="id" value="<%=i%>"/>
							<option value="<%=i%>" <c:if test="${id==semesterID}">SELECTED</c:if>><%=i%>.Semester</option>
							<%  }   %>
						</select>
						<input name="stdg" type="hidden" value="1" />
						
		</form>
		
		<table class="listing">
			<tbody>
				<tr>
					<th>Kursname</th>
					<th>Semester</th>
					<th></th>
				</tr>
				<c:forEach items="${kurse}" var="kurs">
					<tr>
						<td><c:out value="${kurs.name}"/></td>
						<td><c:out value="${kurs.semester}"/></td>
						<td>
							<a href="AddStudentKurs.s?id=<c:out value="${kurs.idKurs}"/>"><input type="button" value="Anmelden/Abmelden" /></a>
						</td>
						
					</tr>
				</c:forEach>  
			</tbody>
		</table>
	</div>		
</body>
</html>